import { http, useUploadFile } from "@/api";
// 获取单页
export const getProductListApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/Index/productList",
        data,
    });
};

// 获取产品详情
export const productdetailApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/Index/productdetail",
        data,
    });
};

// 收藏商品
export const shoucangApi = (data?: any) => {
    return http({
        method: "POST",
        url: "Index/Index/shoucang",
        data,
    });
};

// 取消收藏
export const shoucangcancelApi = (data?: any) => {
    return http({
        method: "POST",
        url: "Index/Index/shoucangcancel",
        data,
    });
};


// 购物车列表
export const cartListApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/index/cartList",
        data,
    });
};

// 添加到购物车
export const addCartApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/index/addCart",
        data,
    });
};

// 设置购物车是否选中
export const setCartCheckApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/index/setCartCheck",
        data,
    });
};


// 设置购物车sku数量
export const setCartNumApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/index/setCart",
        data,
    });
};

// 删除购物车商品
export const delCartApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/index/delCart",
        data,
    });
};


// 获取商品分类
export const allCategoryListApi = (data?: any) => {
    return http({
        method: "POST",
        url: "index/index/allCategoryList",
        data,
    });
};
